home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / OpenTransport / Open Transport 1.0.5b4 / Open Transport SDK / Open Tpt Module Developer / Includes / dlpi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-24  |  38.4 KB  |  1,208 lines  |  [TEXT/MPS ]

  1. /** Copyright (c) 1993  Mentat Inc.
  2.  ** dlpi.h 4.2, last change 15 Jun 1994
  3.  **/
  4.  
  5. #ifndef _SYS_DLPI_H
  6. #define _SYS_DLPI_H
  7.  
  8. /*
  9.  * dlpi.h header for Data Link Provider Interface
  10.  */
  11.  
  12. /*
  13.  * This header file has encoded the values so an existing driver
  14.  * or user which was written with the Logical Link Interface(LLI)
  15.  * can migrate to the DLPI interface in a binary compatible manner.
  16.  * Any fields which require a specific format or value are flagged
  17.  * with a comment containing the message LLI compatibility.
  18.  */
  19.  
  20. /*
  21.  *    DLPI revision definition history
  22.  */
  23. #define DL_CURRENT_VERSION    0x02    /* current version of dlpi */
  24. #define DL_VERSION_2        0x02    /* version of dlpi March 12,1991 */
  25.  
  26. /*
  27.  * Primitives for Local Management Services
  28.  */
  29. #define DL_INFO_REQ         0x00    /* Information Req, LLI compatibility */
  30. #define DL_INFO_ACK         0x03    /* Information Ack, LLI compatibility */
  31. #define DL_ATTACH_REQ        0x0b    /* Attach a PPA */
  32. #define DL_DETACH_REQ        0x0c    /* Detach a PPA */
  33. #define DL_BIND_REQ         0x01    /* Bind dlsap address, LLI compatibility */
  34. #define DL_BIND_ACK         0x04    /* Dlsap address bound, LLI compatibility */
  35. #define DL_UNBIND_REQ        0x02    /* Unbind dlsap address, LLI compatibility */
  36. #define DL_OK_ACK            0x06    /* Success acknowledgment, LLI compatibility */
  37. #define DL_ERROR_ACK        0x05    /* Error acknowledgment, LLI compatibility */
  38. #define DL_SUBS_BIND_REQ    0x1b    /* Bind Subsequent DLSAP address */
  39. #define DL_SUBS_BIND_ACK    0x1c    /* Subsequent DLSAP address bound */
  40. #define DL_SUBS_UNBIND_REQ    0x15    /* Subsequent unbind */
  41. #define DL_ENABMULTI_REQ    0x1d    /* Enable multicast addresses */
  42. #define DL_DISABMULTI_REQ    0x1e    /* Disable multicast addresses */
  43. #define DL_PROMISCON_REQ    0x1f    /* Turn on promiscuous mode */
  44. #define DL_PROMISCOFF_REQ    0x20    /* Turn off promiscuous mode */
  45.  
  46. /*
  47.  * Primitives used for Connectionless Service
  48.  */
  49. #define DL_UNITDATA_REQ     0x07    /* datagram send request, LLI compatibility */
  50. #define DL_UNITDATA_IND     0x08    /* datagram receive indication, LLI compatibility */
  51. #define DL_UDERROR_IND        0x09    /* datagram error indication, LLI compatibility */
  52. #define DL_UDQOS_REQ        0x0a    /* set QOS for subsequent datagram transmissions */
  53.  
  54. /*
  55.  * Primitives used for Connection-Oriented Service
  56.  */
  57. #define DL_CONNECT_REQ        0x0d    /* Connect request */
  58. #define DL_CONNECT_IND        0x0e    /* Incoming connect indication */
  59. #define DL_CONNECT_RES        0x0f    /* Accept previous connect indication */
  60. #define DL_CONNECT_CON        0x10    /* Connection established */
  61.  
  62. #define DL_TOKEN_REQ        0x11    /* Passoff token request */
  63. #define DL_TOKEN_ACK        0x12    /* Passoff token ack */
  64.  
  65. #define DL_DISCONNECT_REQ    0x13    /* Disconnect request */
  66. #define DL_DISCONNECT_IND    0x14    /* Disconnect indication */
  67.  
  68. #define DL_RESET_REQ        0x17    /* Reset service request */
  69. #define DL_RESET_IND        0x18    /* Incoming reset indication */
  70. #define DL_RESET_RES        0x19    /* Complete reset processing */
  71. #define DL_RESET_CON        0x1a    /* Reset processing complete */
  72.  
  73. /*
  74.  *    Primitives used for Acknowledged Connectionless Service
  75.  */
  76.  
  77. #define DL_DATA_ACK_REQ             0x21    /* data unit transmission request */
  78. #define DL_DATA_ACK_IND             0x22    /* Arrival of a command PDU */
  79. #define DL_DATA_ACK_STATUS_IND        0x23    /* Status indication of DATA_ACK_REQ*/
  80. #define DL_REPLY_REQ                0x24    /* Request a DLSDU from the remote */
  81. #define DL_REPLY_IND                0x25    /* Arrival of a command PDU */
  82. #define DL_REPLY_STATUS_IND         0x26    /* Status indication of REPLY_REQ */
  83. #define DL_REPLY_UPDATE_REQ         0x27    /* Hold a DLSDU for transmission */
  84. #define DL_REPLY_UPDATE_STATUS_IND    0x28     /* Status of REPLY_UPDATE req */
  85.  
  86. /*
  87.  * Primitives used for XID and TEST operations
  88.  */
  89.  
  90. #define DL_XID_REQ        0x29        /* Request to send an XID PDU */
  91. #define DL_XID_IND        0x2a        /* Arrival of an XID PDU */
  92. #define DL_XID_RES        0x2b        /* request to send a response XID PDU*/
  93. #define DL_XID_CON        0x2c        /* Arrival of a response XID PDU */
  94. #define DL_TEST_REQ     0x2d        /* TEST command request */
  95. #define DL_TEST_IND     0x2e        /* TEST response indication */
  96. #define DL_TEST_RES     0x2f        /* TEST response */
  97. #define DL_TEST_CON     0x30        /* TEST Confirmation */
  98.  
  99. /*
  100.  * Primitives to get and set the physical address, and to get
  101.  * Statistics
  102.  */
  103.  
  104. #define DL_PHYS_ADDR_REQ        0x31    /* Request to get physical addr */
  105. #define DL_PHYS_ADDR_ACK        0x32    /* Return physical addr */
  106. #define DL_SET_PHYS_ADDR_REQ    0x33    /* set physical addr */
  107. #define DL_GET_STATISTICS_REQ    0x34    /* Request to get statistics */
  108. #define DL_GET_STATISTICS_ACK    0x35    /* Return statistics */
  109.  
  110. /*
  111.  * DLPI interface states
  112.  */
  113. #define DL_UNATTACHED            0x04    /* PPA not attached */
  114. #define DL_ATTACH_PENDING        0x05    /* Waiting ack of DL_ATTACH_REQ */
  115. #define DL_DETACH_PENDING        0x06    /* Waiting ack of DL_DETACH_REQ */
  116. #define DL_UNBOUND                0x00    /* PPA attached, LLI compatibility */
  117. #define DL_BIND_PENDING         0x01    /* Waiting ack of DL_BIND_REQ, LLI compatibility */
  118. #define DL_UNBIND_PENDING        0x02    /* Waiting ack of DL_UNBIND_REQ, LLI compatibility */
  119. #define DL_IDLE                 0x03    /* dlsap bound, awaiting use, LLI compatibility */
  120. #define DL_UDQOS_PENDING        0x07    /* Waiting ack of DL_UDQOS_REQ */
  121. #define DL_OUTCON_PENDING        0x08    /* outgoing connection, awaiting DL_CONN_CON */
  122. #define DL_INCON_PENDING        0x09    /* incoming connection, awaiting DL_CONN_RES */
  123. #define DL_CONN_RES_PENDING     0x0a    /* Waiting ack of DL_CONNECT_RES */
  124. #define DL_DATAXFER             0x0b    /* connection-oriented data transfer */
  125. #define DL_USER_RESET_PENDING    0x0c    /* user initiated reset, awaiting DL_RESET_CON */
  126. #define DL_PROV_RESET_PENDING    0x0d    /* provider initiated reset, awaiting DL_RESET_RES */
  127. #define DL_RESET_RES_PENDING    0x0e    /* Waiting ack of DL_RESET_RES */
  128. #define DL_DISCON8_PENDING        0x0f    /* Waiting ack of DL_DISC_REQ when in DL_OUTCON_PENDING */
  129. #define DL_DISCON9_PENDING        0x10    /* Waiting ack of DL_DISC_REQ when in DL_INCON_PENDING */
  130. #define DL_DISCON11_PENDING     0x11    /* Waiting ack of DL_DISC_REQ when in DL_DATAXFER */
  131. #define DL_DISCON12_PENDING     0x12    /* Waiting ack of DL_DISC_REQ when in DL_USER_RESET_PENDING */
  132. #define DL_DISCON13_PENDING     0x13    /* Waiting ack of DL_DISC_REQ when in DL_DL_PROV_RESET_PENDING */
  133. #define DL_SUBS_BIND_PND        0x14    /* Waiting ack of DL_SUBS_BIND_REQ */
  134. #define DL_SUBS_UNBIND_PND        0x15    /* Waiting ack of DL_SUBS_UNBIND_REQ */
  135.  
  136. /*
  137.  * DL_ERROR_ACK error return values
  138.  */
  139. #define DL_ACCESS        0x02    /* Improper permissions for request, LLI compatibility */
  140. #define DL_BADADDR        0x01    /* DLSAP address in improper format or invalid */
  141. #define DL_BADCORR        0x05    /* Sequence number not from outstanding DL_CONN_IND */
  142. #define DL_BADDATA        0x06    /* User data exceeded provider limit */
  143. #define DL_BADPPA        0x08    /* Specified PPA was invalid */
  144. #define DL_BADPRIM        0x09    /* Primitive received is not known by DLS provider */
  145. #define DL_BADQOSPARAM    0x0a    /* QOS parameters contained invalid values */
  146. #define DL_BADQOSTYPE    0x0b    /* QOS structure type is unknown or unsupported */
  147. #define DL_BADSAP        0x00    /* Bad LSAP selector, LLI compatibility */
  148. #define DL_BADTOKEN     0x0c    /* Token used not associated with an active stream */
  149. #define DL_BOUND        0x0d    /* Attempted second bind with dl_max_conind or    */
  150.                                 /*    dl_conn_mgmt > 0 on same DLSAP or PPA */
  151. #define DL_INITFAILED    0x0e    /* Physical Link initialization failed */
  152. #define DL_NOADDR        0x0f    /* Provider couldn't allocate alternate address */
  153. #define DL_NOTINIT        0x10    /* Physical Link not initialized */
  154. #define DL_OUTSTATE     0x03    /* Primitive issued in improper state, LLI compatibility */
  155. #define DL_SYSERR        0x04    /* UNIX system error occurred, LLI compatibility */
  156. #define DL_UNSUPPORTED    0x07    /* Requested service not supplied by provider */
  157. #define DL_UNDELIVERABLE 0x11    /* Previous data unit could not be delivered */
  158. #define DL_NOTSUPPORTED  0x12    /* Primitive is known but not supported by DLS provider */
  159. #define DL_TOOMANY        0x13    /* limit exceeded    */
  160. #define DL_NOTENAB        0x14    /* Promiscuous mode not enabled */
  161. #define DL_BUSY         0x15    /* Other streams for a particular PPA in the
  162.                                      post-attached state */
  163.  
  164. #define DL_NOAUTO        0x16    /* Automatic handling of XID & TEST responses
  165.                                    not supported */
  166. #define DL_NOXIDAUTO    0x17    /* Automatic handling of XID not supported */
  167. #define DL_NOTESTAUTO    0x18    /* Automatic handling of TEST not supported */
  168. #define DL_XIDAUTO        0x19    /* Automatic handling of XID response */
  169. #define DL_TESTAUTO     0x1a    /* AUtomatic handling of TEST response*/
  170. #define DL_PENDING        0x1b    /* pending outstanding connect indications */
  171.  
  172. /*
  173.  * DLPI media types supported
  174.  */
  175. #define DL_CSMACD    0x0     /* IEEE 802.3 CSMA/CD network, LLI Compatibility */
  176. #define DL_TPB        0x1     /* IEEE 802.4 Token Passing Bus, LLI Compatibility */
  177. #define DL_TPR        0x2     /* IEEE 802.5 Token Passing Ring, LLI Compatibility */
  178. #define DL_METRO    0x3     /* IEEE 802.6 Metro Net, LLI Compatibility */
  179. #define DL_ETHER    0x4     /* Ethernet Bus, LLI Compatibility */
  180. #define DL_HDLC     0x05    /* ISO HDLC protocol support, bit synchronous */
  181. #define DL_CHAR     0x06    /* Character Synchronous protocol support, eg BISYNC */
  182. #define DL_CTCA     0x07    /* IBM Channel-to-Channel Adapter */
  183. #define DL_FDDI     0x08    /* Fiber Distributed data interface */
  184. #define DL_OTHER    0x09    /* Any other medium not listed above */
  185.  
  186. /*
  187.  * DLPI provider service supported.
  188.  * These must be allowed to be bitwise-OR for dl_service_mode in
  189.  * DL_INFO_ACK.
  190.  */
  191. #define DL_CODLS    0x01    /* support connection-oriented service */
  192. #define DL_CLDLS    0x02    /* support connectionless data link service */
  193. #define DL_ACLDLS    0x04    /* support acknowledged connectionless service*/
  194.  
  195. /*
  196.  * DLPI provider style.
  197.  * The DLPI provider style which determines whether a provider
  198.  * requires a DL_ATTACH_REQ to inform the provider which PPA
  199.  * user messages should be sent/received on.
  200.  */
  201. #define DL_STYLE1    0x0500    /* PPA is implicitly bound by open(2) */
  202. #define DL_STYLE2    0x0501    /* PPA must be explicitly bound via DL_ATTACH_REQ */
  203.  
  204. /*
  205.  * DLPI Originator for Disconnect and Resets
  206.  */
  207. #define DL_PROVIDER     0x0700
  208. #define DL_USER         0x0701
  209.  
  210. /*
  211.  * DLPI Disconnect Reasons
  212.  */
  213. #define DL_CONREJ_DEST_UNKNOWN                0x0800
  214. #ifndef VMS
  215. #define DL_CONREJ_DEST_UNREACH_PERMANENT    0x0801
  216. #define DL_CONREJ_DEST_UNREACH_TRANSIENT    0x0802
  217. #else
  218. #define DL_CONREJ_DEST_UNREACH_PERMANEN     0x0801
  219. #define DL_CONREJ_DEST_UNREACH_TRANSIEN     0x0802
  220. #endif
  221. #define DL_CONREJ_QOS_UNAVAIL_PERMANENT     0x0803
  222. #define DL_CONREJ_QOS_UNAVAIL_TRANSIENT     0x0804
  223. #define DL_CONREJ_PERMANENT_COND            0x0805
  224. #define DL_CONREJ_TRANSIENT_COND            0x0806
  225. #define DL_DISC_ABNORMAL_CONDITION            0x0807
  226. #define DL_DISC_NORMAL_CONDITION            0x0808
  227. #define DL_DISC_PERMANENT_CONDITION         0x0809
  228. #define DL_DISC_TRANSIENT_CONDITION         0x080a
  229. #define DL_DISC_UNSPECIFIED                 0x080b
  230.  
  231. /*
  232.  * DLPI Reset Reasons
  233.  */
  234. #define DL_RESET_FLOW_CONTROL    0x0900
  235. #define DL_RESET_LINK_ERROR     0x0901
  236. #define DL_RESET_RESYNCH        0x0902
  237.  
  238. /*
  239.  * DLPI status values for acknowledged connectionless data transfer
  240.  */
  241. #define DL_CMD_MASK     0x0f    /* mask for command portion of status */
  242. #define DL_CMD_OK        0x00    /* Command Accepted */
  243. #define DL_CMD_RS        0x01    /* Unimplemented or inactivated service */
  244. #define DL_CMD_UE        0x05    /* Data Link User interface error */
  245. #define DL_CMD_PE        0x06    /* Protocol error */
  246. #define DL_CMD_IP        0x07    /* Permanent implementation dependent error*/
  247. #define DL_CMD_UN        0x09    /* Resources temporarily unavailable */
  248. #define DL_CMD_IT        0x0f    /* Temporary implementation dependent error */
  249. #define DL_RSP_MASK     0xf0    /* mask for response portion of status */
  250. #define DL_RSP_OK        0x00    /* Response DLSDU present */
  251. #define DL_RSP_RS        0x10    /* Unimplemented or inactivated service */
  252. #define DL_RSP_NE        0x30    /* Response DLSDU never submitted */
  253. #define DL_RSP_NR        0x40    /* Response DLSDU not requested */
  254. #define DL_RSP_UE        0x50    /* Data Link User interface error */
  255. #define DL_RSP_IP        0x70    /* Permanent implementation dependent error */
  256. #define DL_RSP_UN        0x90    /* Resources temporarily unavailable */
  257. #define DL_RSP_IT        0xf0    /* Temporary implementation dependent error */
  258.  
  259. /*
  260.  * Service Class values for acknowledged connectionless data transfer
  261.  */
  262. #define DL_RQST_RSP     0x01    /* Use acknowledge capability in MAC sublayer*/
  263. #define DL_RQST_NORSP    0x02    /* No acknowledgement service requested */
  264.  
  265. /*
  266.  * DLPI address type definition
  267.  */
  268. #define DL_FACT_PHYS_ADDR    0x01    /* factory physical address */
  269. #define DL_CURR_PHYS_ADDR    0x02    /* current physical address */
  270.  
  271. /*
  272.  * DLPI flag definitions
  273.  */
  274. #define DL_POLL_FINAL    0x01        /* if set,indicates poll/final bit set*/
  275.  
  276. /*
  277.  *    XID and TEST responses supported by the provider
  278.  */
  279. #define DL_AUTO_XID     0x01        /* provider will respond to XID */
  280. #define DL_AUTO_TEST    0x02        /* provider will respond to TEST */
  281.  
  282. /*
  283.  * Subsequent bind type
  284.  */
  285. #define DL_PEER_BIND            0x01    /* subsequent bind on a peer addr */
  286. #define DL_HIERARCHICAL_BIND    0x02    /* subs_bind on a hierarchical addr*/
  287.  
  288. /*
  289.  * DLPI promiscuous mode definitions
  290.  */
  291. #define DL_PROMISC_PHYS     0x01    /* promiscuous mode at phys level */
  292. #define DL_PROMISC_SAP        0x02    /* promiscous mode at sap level */
  293. #define DL_PROMISC_MULTI    0x03    /* promiscuous mode for multicast */
  294.  
  295. /*
  296.  * DLPI Quality Of Service definition for use in QOS structure definitions.
  297.  * The QOS structures are used in connection establishment, DL_INFO_ACK,
  298.  * and setting connectionless QOS values.
  299.  */
  300.  
  301. /*
  302.  * Throughput
  303.  *
  304.  * This parameter is specified for both directions.
  305.  */
  306. typedef struct 
  307. {
  308.         SInt32    dl_target_value;    /* desired bits/second desired */
  309.         SInt32    dl_accept_value;    /* min. acceptable bits/second */
  310. } dl_through_t;
  311.  
  312. /*
  313.  * transit delay specification
  314.  *
  315.  * This parameter is specified for both directions.
  316.  * expressed in milliseconds assuming a DLSDU size of 128 octets.
  317.  * The scaling of the value to the current DLSDU size is provider dependent.
  318.  */
  319. typedef struct 
  320. {
  321.         SInt32    dl_target_value;    /* desired value of service */
  322.         SInt32    dl_accept_value;    /* min. acceptable value of service */
  323. } dl_transdelay_t;
  324.  
  325. /*
  326.  * priority specification
  327.  * priority range is 0-100, with 0 being highest value.
  328.  */
  329. typedef struct 
  330. {
  331.         SInt32    dl_min;
  332.         SInt32    dl_max;
  333. } dl_priority_t;
  334.  
  335. /*
  336.  * protection specification
  337.  *
  338.  */
  339. #define DL_NONE         0x0B01    /* no protection supplied */
  340. #define DL_MONITOR        0x0B02    /* protection against passive monitoring */
  341. #define DL_MAXIMUM        0x0B03    /* protection against modification, replay, */
  342.                                 /* addition, or deletion */
  343.  
  344. typedef struct 
  345. {
  346.         SInt32    dl_min;
  347.         SInt32    dl_max;
  348. } dl_protect_t;
  349.  
  350. /*
  351.  * Resilience specification
  352.  * probabilities are scaled by a factor of 10,000 with a time interval
  353.  * of 10,000 seconds.
  354.  */
  355. typedef struct 
  356. {
  357.         SInt32    dl_disc_prob;    /* probability of provider init DISC */
  358.         SInt32    dl_reset_prob;    /* probability of provider init RESET */
  359. } dl_resilience_t;
  360.  
  361. /*
  362.  * QOS type definition to be used for negotiation with the
  363.  * remote end of a connection, or a connectionless unitdata request.
  364.  * There are two type definitions to handle the negotiation 
  365.  * process at connection establishment. The typedef dl_qos_range_t
  366.  * is used to present a range for parameters. This is used
  367.  * in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
  368.  * dl_qos_sel_t is used to select a specific value for the QOS
  369.  * parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
  370.  * and DL_INFO_ACK messages to define the selected QOS parameters
  371.  * for a connection.
  372.  *
  373.  * NOTE
  374.  *    A DataLink provider which has unknown values for any of the fields
  375.  *    will use a value of DL_UNKNOWN for all values in the fields.
  376.  *
  377.  * NOTE
  378.  *    A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
  379.  *    provider the user requesting this value doesn't care 
  380.  *    what the QOS parameter is set to. This value becomes the
  381.  *    least possible value in the range of QOS parameters.
  382.  *    The order of the QOS parameter range is then:
  383.  *
  384.  *        DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
  385.  */
  386. #define DL_UNKNOWN        -1
  387. #define DL_QOS_DONT_CARE    -2
  388.  
  389. /*
  390.  * Every QOS structure has the first 4 bytes containing a type
  391.  * field, denoting the definition of the rest of the structure.
  392.  * This is used in the same manner has the dl_primitive variable
  393.  * is in messages.
  394.  *
  395.  * The following list is the defined QOS structure type values and structures.
  396.  */
  397. #define DL_QOS_CO_RANGE1    0x0101    /* QOS range struct. for Connection modeservice */
  398. #define DL_QOS_CO_SEL1        0x0102    /* QOS selection structure */
  399. #define DL_QOS_CL_RANGE1    0x0103    /* QOS range struct. for connectionless*/
  400. #define DL_QOS_CL_SEL1        0x0104    /* QOS selection for connectionless mode*/
  401.  
  402. typedef struct 
  403. {
  404.         UInt32            dl_qos_type;
  405.         dl_through_t    dl_rcv_throughput;    /* desired and acceptable*/
  406.         dl_transdelay_t dl_rcv_trans_delay; /* desired and acceptable*/
  407.         dl_through_t    dl_xmt_throughput;
  408.         dl_transdelay_t dl_xmt_trans_delay;
  409.         dl_priority_t    dl_priority;        /* min and max values */
  410.         dl_protect_t    dl_protection;        /* min and max values */
  411.         SInt32            dl_residual_error;
  412.         dl_resilience_t dl_resilience;
  413. }    dl_qos_co_range1_t;
  414.  
  415. typedef struct 
  416. {
  417.         UInt32            dl_qos_type;
  418.         SInt32            dl_rcv_throughput;
  419.         SInt32            dl_rcv_trans_delay;
  420.         SInt32            dl_xmt_throughput;
  421.         SInt32            dl_xmt_trans_delay;
  422.         SInt32            dl_priority;
  423.         SInt32            dl_protection;
  424.         SInt32            dl_residual_error;
  425.         dl_resilience_t    dl_resilience;
  426. }    dl_qos_co_sel1_t;
  427.  
  428. typedef struct 
  429. {
  430.         UInt32            dl_qos_type;
  431.         dl_transdelay_t dl_trans_delay;
  432.         dl_priority_t    dl_priority;
  433.         dl_protect_t    dl_protection;
  434.         SInt32            dl_residual_error;
  435. }    dl_qos_cl_range1_t;
  436.  
  437. typedef struct 
  438. {
  439.         UInt32        dl_qos_type;
  440.         SInt32        dl_trans_delay;
  441.         SInt32        dl_priority;
  442.         SInt32        dl_protection;
  443.         SInt32        dl_residual_error;
  444. }    dl_qos_cl_sel1_t;
  445.  
  446. /*
  447.  * DLPI interface primitive definitions.
  448.  *
  449.  * Each primitive is sent as a stream message.    It is possible that
  450.  * the messages may be viewed as a sequence of bytes that have the
  451.  * following form without any padding. The structure definition
  452.  * of the following messages may have to change depending on the
  453.  * underlying hardware architecture and crossing of a hardware
  454.  * boundary with a different hardware architecture.
  455.  *
  456.  * Fields in the primitives having a name of the form
  457.  * dl_reserved cannot be used and have the value of
  458.  * binary zero, no bits turned on.
  459.  *
  460.  * Each message has the name defined followed by the
  461.  * stream message type (M_PROTO, M_PCPROTO, M_DATA)
  462.  */
  463.  
  464. /*
  465.  *    LOCAL MANAGEMENT SERVICE PRIMITIVES
  466.  */
  467.  
  468. /*
  469.  * DL_INFO_REQ, M_PCPROTO type
  470.  */
  471. typedef struct 
  472. {
  473.     UInt32    dl_primitive;            /* set to DL_INFO_REQ */
  474. } dl_info_req_t;
  475.  
  476. /*
  477.  * DL_INFO_ACK, M_PCPROTO type
  478.  */
  479. typedef struct 
  480. {
  481.     UInt32        dl_primitive;            /* set to DL_INFO_ACK */
  482.     UInt32        dl_max_sdu;             /* Max bytes in a DLSDU */
  483.     UInt32        dl_min_sdu;             /* Min bytes in a DLSDU */
  484.     UInt32        dl_addr_length;         /* length of DLSAP address */
  485.     UInt32        dl_mac_type;            /* type of medium supported*/
  486.     UInt32        dl_reserved;            /* value set to zero */
  487.     UInt32        dl_current_state;        /* state of DLPI interface */
  488.     SInt32        dl_sap_length;            /* current length of SAP part of
  489.                                            dlsap address */
  490.     UInt32        dl_service_mode;        /* CO, CL or ACL */
  491.     UInt32        dl_qos_length;            /* length of qos values */
  492.     UInt32        dl_qos_offset;            /* offset from beg. of block*/
  493.     UInt32        dl_qos_range_length;    /* available range of qos */
  494.     UInt32        dl_qos_range_offset;    /* offset from beg. of block*/
  495.     UInt32        dl_provider_style;        /* style1 or style2 */
  496.     UInt32        dl_addr_offset;         /* offset of the dlsap addr */
  497.     UInt32        dl_version;             /* version number */
  498.     UInt32        dl_brdcst_addr_length;    /* length of broadcast addr */
  499.     UInt32        dl_brdcst_addr_offset;    /* offset from beg. of block*/
  500.     UInt32        dl_growth;                /* set to zero */
  501. } dl_info_ack_t;
  502.  
  503. /*
  504.  * DL_ATTACH_REQ, M_PROTO type
  505.  */
  506. typedef struct 
  507. {
  508.     UInt32        dl_primitive;        /* set to DL_ATTACH_REQ*/
  509.     UInt32        dl_ppa;             /* id of the PPA */
  510. } dl_attach_req_t;
  511.  
  512. /*
  513.  * DL_DETACH_REQ, M_PROTO type
  514.  */
  515. typedef struct 
  516. {
  517.     UInt32    dl_primitive;            /* set to DL_DETACH_REQ */
  518. } dl_detach_req_t;
  519.  
  520. /*
  521.  * DL_BIND_REQ, M_PROTO type
  522.  */
  523. typedef struct 
  524. {
  525.     UInt32    dl_primitive;        /* set to DL_BIND_REQ */
  526.     UInt32    dl_sap;             /* info to identify dlsap addr*/
  527.     UInt32    dl_max_conind;        /* max # of outstanding con_ind*/
  528.     UInt16    dl_service_mode;    /* CO, CL or ACL */     
  529.     UInt16    dl_conn_mgmt;        /* if non-zero, is con-mgmt stream*/
  530.     UInt32    dl_xidtest_flg;     /* if set to 1 indicates automatic
  531.                                    initiation of test and xid frames */
  532. } dl_bind_req_t;
  533.  
  534. /*
  535.  * DL_BIND_ACK, M_PCPROTO type
  536.  */
  537. typedef struct 
  538. {
  539.     UInt32    dl_primitive;        /* DL_BIND_ACK */
  540.     UInt32    dl_sap;             /* DLSAP addr info */
  541.     UInt32    dl_addr_length;     /* length of complete DLSAP addr */
  542.     UInt32    dl_addr_offset;     /* offset from beginning of M_PCPROTO*/
  543.     UInt32    dl_max_conind;        /* allowed max. # of con-ind */
  544.     UInt32    dl_xidtest_flg;     /* responses supported by provider*/
  545. } dl_bind_ack_t;
  546.  
  547. /*
  548.  * DL_SUBS_BIND_REQ, M_PROTO type
  549.  */
  550. typedef struct 
  551. {
  552.     UInt32    dl_primitive;            /* DL_SUBS_BIND_REQ */
  553.     UInt32    dl_subs_sap_offset;     /* offset of subs_sap */
  554.     UInt32    dl_subs_sap_length;     /* length of subs_sap */
  555.     UInt32    dl_subs_bind_class;     /* peer or hierarchical */
  556. } dl_subs_bind_req_t;
  557.  
  558. /*
  559.  * DL_SUBS_BIND_ACK, M_PCPROTO type
  560.  */
  561. typedef struct 
  562. {
  563.     UInt32 dl_primitive;         /* DL_SUBS_BIND_ACK */
  564.     UInt32 dl_subs_sap_offset;    /* offset of subs_sap */
  565.     UInt32 dl_subs_sap_length;    /* length of subs_sap */
  566. } dl_subs_bind_ack_t;
  567.  
  568. /*
  569.  * DL_UNBIND_REQ, M_PROTO type
  570.  */
  571. typedef struct 
  572. {
  573.     UInt32    dl_primitive;        /* DL_UNBIND_REQ */
  574. } dl_unbind_req_t;
  575.  
  576. /*
  577.  * DL_SUBS_UNBIND_REQ, M_PROTO type
  578.  */
  579. typedef struct 
  580. {
  581.     UInt32    dl_primitive;            /* DL_SUBS_UNBIND_REQ */
  582.     UInt32    dl_subs_sap_offset;     /* offset of subs_sap */
  583.     UInt32    dl_subs_sap_length;     /* length of subs_sap */
  584. } dl_subs_unbind_req_t;
  585.  
  586. /*
  587.  * DL_OK_ACK, M_PCPROTO type
  588.  */
  589. typedef struct 
  590. {
  591.     UInt32    dl_primitive;            /* DL_OK_ACK */
  592.     UInt32    dl_correct_primitive;    /* primitive being acknowledged */
  593. } dl_ok_ack_t;
  594.  
  595. /*
  596.  * DL_ERROR_ACK, M_PCPROTO type
  597.  */
  598. typedef struct 
  599. {
  600.     UInt32    dl_primitive;            /* DL_ERROR_ACK */
  601.     UInt32    dl_error_primitive;     /* primitive in error */
  602.     UInt32    dl_errno;                /* DLPI error code */
  603.     UInt32    dl_unix_errno;            /* UNIX system error code */
  604. } dl_error_ack_t;
  605.  
  606. /*
  607.  * DL_ENABMULTI_REQ, M_PROTO type
  608.  */
  609. typedef struct 
  610. {
  611.     UInt32    dl_primitive;        /* DL_ENABMULTI_REQ */
  612.     UInt32    dl_addr_length;     /* length of multicast address */
  613.     UInt32    dl_addr_offset;     /* offset from beg. of M_PROTO block*/
  614. } dl_enabmulti_req_t;
  615.  
  616. /*
  617.  * DL_DISABMULTI_REQ, M_PROTO type
  618.  */
  619.  
  620. typedef struct 
  621. {
  622.     UInt32    dl_primitive;        /* DL_DISABMULTI_REQ */
  623.     UInt32    dl_addr_length;     /* length of multicast address */
  624.     UInt32    dl_addr_offset;     /* offset from beg. of M_PROTO block*/
  625. } dl_disabmulti_req_t;
  626.  
  627. /*
  628.  * DL_PROMISCON_REQ, M_PROTO type
  629.  */
  630.  
  631. typedef struct 
  632. {
  633.     UInt32    dl_primitive;        /* DL_PROMISCON_REQ */
  634.     UInt32    dl_level;            /* physical,SAP level or ALL multicast*/
  635. } dl_promiscon_req_t;
  636.  
  637. /*
  638.  * DL_PROMISCOFF_REQ, M_PROTO type
  639.  */
  640.  
  641. typedef struct 
  642. {
  643.     UInt32    dl_primitive;        /* DL_PROMISCOFF_REQ */
  644.     UInt32    dl_level;            /* Physical,SAP level or ALL multicast*/
  645. } dl_promiscoff_req_t;
  646.  
  647. /*
  648.  *    Primitives to get and set the Physical address
  649.  */
  650.  
  651. /*
  652.  * DL_PHYS_ADDR_REQ, M_PROTO type
  653.  */
  654. typedef struct 
  655. {
  656.     UInt32    dl_primitive;        /* DL_PHYS_ADDR_REQ */
  657.     UInt32    dl_addr_type;        /* factory or current physical addr */
  658. } dl_phys_addr_req_t;
  659.  
  660. /*
  661.  * DL_PHYS_ADDR_ACK, M_PCPROTO type
  662.  */
  663. typedef struct 
  664. {
  665.     UInt32    dl_primitive;        /* DL_PHYS_ADDR_ACK */
  666.     UInt32    dl_addr_length;     /* length of the physical addr */
  667.     UInt32    dl_addr_offset;     /* offset from beg. of block */
  668. } dl_phys_addr_ack_t;
  669.  
  670. /*
  671.  * DL_SET_PHYS_ADDR_REQ, M_PROTO type
  672.  */
  673. typedef struct 
  674. {
  675.     UInt32    dl_primitive;        /* DL_SET_PHYS_ADDR_REQ */
  676.     UInt32    dl_addr_length;     /* length of physical addr */
  677.     UInt32    dl_addr_offset;     /* offset from beg. of block */
  678. } dl_set_phys_addr_req_t;
  679.  
  680. /*
  681.  *    Primitives to get statistics
  682.  */
  683.  
  684. /*
  685.  * DL_GET_STATISTICS_REQ, M_PROTO type
  686.  */
  687. typedef struct 
  688. {
  689.     UInt32    dl_primitive;        /* DL_GET_STATISTICS_REQ */
  690. } dl_get_statistics_req_t;
  691.  
  692. /*
  693.  * DL_GET_STATISTICS_ACK, M_PCPROTO type
  694.  */
  695. typedef struct 
  696. {
  697.     UInt32    dl_primitive;        /* DL_GET_STATISTICS_ACK */
  698.     UInt32    dl_stat_length;     /* length of statistics structure*/
  699.     UInt32    dl_stat_offset;     /* offset from beg. of block */
  700. } dl_get_statistics_ack_t;
  701.  
  702. /*
  703.  *    CONNECTION-ORIENTED SERVICE PRIMITIVES
  704.  */
  705.  
  706. /*
  707.  * DL_CONNECT_REQ, M_PROTO type
  708.  */
  709. typedef struct 
  710. {
  711.     UInt32    dl_primitive;            /* DL_CONNECT_REQ */
  712.     UInt32    dl_dest_addr_length;    /* len. of dlsap addr*/
  713.     UInt32    dl_dest_addr_offset;    /* offset */
  714.     UInt32    dl_qos_length;            /* len. of QOS parm val*/
  715.     UInt32    dl_qos_offset;            /* offset */
  716.     UInt32    dl_growth;                /* set to zero */
  717. } dl_connect_req_t;
  718.  
  719. /*
  720.  * DL_CONNECT_IND, M_PROTO type
  721.  */
  722. typedef struct 
  723. {
  724.     UInt32    dl_primitive;            /* DL_CONNECT_IND */
  725.     UInt32    dl_correlation;         /* provider's correlation token*/
  726.     UInt32    dl_called_addr_length;    /* length of called address */
  727.     UInt32    dl_called_addr_offset;    /* offset from beginning of block */
  728.     UInt32    dl_calling_addr_length; /* length of calling address */
  729.     UInt32    dl_calling_addr_offset; /* offset from beginning of block */
  730.     UInt32    dl_qos_length;            /* length of qos structure */
  731.     UInt32    dl_qos_offset;            /* offset from beginning of block */
  732.     UInt32    dl_growth;                /* set to zero */
  733. } dl_connect_ind_t;
  734.  
  735. /*
  736.  * DL_CONNECT_RES, M_PROTO type
  737.  */
  738. typedef struct 
  739. {
  740.     UInt32    dl_primitive;    /* DL_CONNECT_RES */
  741.     UInt32    dl_correlation; /* provider's correlation token */
  742.     UInt32    dl_resp_token;    /* token associated with responding stream */
  743.     UInt32    dl_qos_length;    /* length of qos structure */
  744.     UInt32    dl_qos_offset;    /* offset from beginning of block */
  745.     UInt32    dl_growth;        /* set to zero */
  746. } dl_connect_res_t;
  747.  
  748. /*
  749.  * DL_CONNECT_CON, M_PROTO type
  750.  */
  751. typedef struct 
  752. {
  753.     UInt32    dl_primitive;            /* DL_CONNECT_CON*/
  754.     UInt32    dl_resp_addr_length;    /* length of responder's address */
  755.     UInt32    dl_resp_addr_offset;    /* offset from beginning of block*/
  756.     UInt32    dl_qos_length;            /* length of qos structure */
  757.     UInt32    dl_qos_offset;            /* offset from beginning of block*/
  758.     UInt32    dl_growth;                /* set to zero */
  759. } dl_connect_con_t;
  760.  
  761. /*
  762.  * DL_TOKEN_REQ, M_PCPROTO type
  763.  */
  764. typedef struct 
  765. {
  766.     UInt32    dl_primitive;        /* DL_TOKEN_REQ */
  767. } dl_token_req_t;
  768.  
  769. /*
  770.  * DL_TOKEN_ACK, M_PCPROTO type
  771.  */
  772. typedef struct 
  773. {
  774.     UInt32    dl_primitive;    /* DL_TOKEN_ACK */
  775.     UInt32    dl_token;        /* Connection response token associated
  776.                                with the stream */
  777. }dl_token_ack_t;
  778.  
  779. /*
  780.  * DL_DISCONNECT_REQ, M_PROTO type
  781.  */
  782. typedef struct 
  783. {
  784.     UInt32        dl_primitive;    /* DL_DISCONNECT_REQ */
  785.     UInt32        dl_reason;        /*normal, abnormal, perm. or transient*/
  786.     UInt32        dl_correlation; /* association with connect_ind */
  787. } dl_disconnect_req_t;
  788.  
  789. /*
  790.  * DL_DISCONNECT_IND, M_PROTO type
  791.  */
  792. typedef struct 
  793. {
  794.     UInt32    dl_primitive;        /* DL_DISCONNECT_IND */
  795.     UInt32    dl_originator;        /* USER or PROVIDER */
  796.     UInt32    dl_reason;            /* permanent or transient */
  797.     UInt32    dl_correlation;     /* association with connect_ind */
  798. } dl_disconnect_ind_t;
  799.  
  800. /*
  801.  * DL_RESET_REQ, M_PROTO type
  802.  */
  803. typedef struct 
  804. {
  805.     UInt32    dl_primitive;        /* DL_RESET_REQ */
  806. } dl_reset_req_t;
  807.  
  808. /*
  809.  * DL_RESET_IND, M_PROTO type
  810.  */
  811. typedef struct 
  812. {
  813.     UInt32    dl_primitive;        /* DL_RESET_IND */
  814.     UInt32    dl_originator;        /* Provider or User */
  815.     UInt32    dl_reason;            /* flow control, link error or resynch*/
  816. } dl_reset_ind_t;
  817.  
  818. /*
  819.  * DL_RESET_RES, M_PROTO type
  820.  */
  821. typedef struct 
  822. {
  823.     UInt32    dl_primitive;        /* DL_RESET_RES */
  824. } dl_reset_res_t;
  825.  
  826. /*
  827.  * DL_RESET_CON, M_PROTO type
  828.  */
  829. typedef struct 
  830. {
  831.     UInt32    dl_primitive;        /* DL_RESET_CON */
  832. } dl_reset_con_t;
  833.  
  834. /*
  835.  *    CONNECTIONLESS SERVICE PRIMITIVES
  836.  */
  837.  
  838. /*
  839.  * DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)
  840.  */
  841. typedef struct 
  842. {
  843.     UInt32    dl_primitive;            /* DL_UNITDATA_REQ */
  844.     UInt32    dl_dest_addr_length;    /* DLSAP length of dest. user */
  845.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  846.     dl_priority_t    dl_priority;    /* priority value */
  847. } dl_unitdata_req_t;
  848.  
  849. /*
  850.  * DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)
  851.  */
  852. typedef struct 
  853. {
  854.     UInt32    dl_primitive;            /* DL_UNITDATA_IND */
  855.     UInt32    dl_dest_addr_length;    /* DLSAP length of dest. user */
  856.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  857.     UInt32    dl_src_addr_length;     /* DLSAP addr length of sending user*/
  858.     UInt32    dl_src_addr_offset;     /* offset from beg. of block */
  859.     UInt32    dl_group_address;        /* set to one if multicast/broadcast*/
  860. } dl_unitdata_ind_t;
  861.  
  862. /*
  863.  * DL_UDERROR_IND, M_PROTO type
  864.  *    (or M_PCPROTO type if LLI-based provider)
  865.  */
  866. typedef struct 
  867. {
  868.     UInt32    dl_primitive;            /* DL_UDERROR_IND */
  869.     UInt32    dl_dest_addr_length;    /* Destination DLSAP */
  870.     UInt32    dl_dest_addr_offset;    /* Offset from beg. of block */
  871.     UInt32    dl_unix_errno;            /* unix system error code*/
  872.     UInt32    dl_errno;                /* DLPI error code */
  873. } dl_uderror_ind_t;
  874.  
  875. /*
  876.  * DL_UDQOS_REQ, M_PROTO type
  877.  */
  878. typedef struct 
  879. {
  880.     UInt32    dl_primitive;        /* DL_UDQOS_REQ */
  881.     UInt32    dl_qos_length;        /* length in bytes of requested qos*/
  882.     UInt32    dl_qos_offset;        /* offset from beg. of block */
  883. } dl_udqos_req_t;
  884.  
  885. /*
  886.  *    Primitives to handle XID and TEST operations
  887.  */
  888.  
  889. /*
  890.  * DL_TEST_REQ, M_PROTO type
  891.  */
  892. typedef struct 
  893. {
  894.     UInt32    dl_primitive;            /* DL_TEST_REQ */
  895.     UInt32    dl_flag;                /* poll/final */
  896.     UInt32    dl_dest_addr_length;    /* DLSAP length of dest. user */
  897.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  898. } dl_test_req_t;
  899.  
  900. /*
  901.  * DL_TEST_IND, M_PROTO type
  902.  */
  903. typedef struct 
  904. {
  905.     UInt32    dl_primitive;            /* DL_TEST_IND */
  906.     UInt32    dl_flag;                /* poll/final */
  907.     UInt32    dl_dest_addr_length;    /* dlsap length of dest. user */
  908.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  909.     UInt32    dl_src_addr_length;     /* dlsap length of source user */
  910.     UInt32    dl_src_addr_offset;     /* offset from beg. of block */
  911. } dl_test_ind_t;
  912.  
  913. /*
  914.  *    DL_TEST_RES, M_PROTO type
  915.  */
  916. typedef struct 
  917. {
  918.     UInt32    dl_primitive;            /* DL_TEST_RES */
  919.     UInt32    dl_flag;                /* poll/final */
  920.     UInt32    dl_dest_addr_length;    /* DLSAP length of dest. user */
  921.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  922. } dl_test_res_t;
  923.  
  924. /*
  925.  *    DL_TEST_CON, M_PROTO type
  926.  */
  927. typedef struct 
  928. {
  929.     UInt32    dl_primitive;            /* DL_TEST_CON */
  930.     UInt32    dl_flag;                /* poll/final */
  931.     UInt32    dl_dest_addr_length;    /* dlsap length of dest. user */
  932.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  933.     UInt32    dl_src_addr_length;     /* dlsap length of source user */
  934.     UInt32    dl_src_addr_offset;     /* offset from beg. of block */
  935. } dl_test_con_t;
  936.  
  937. /*
  938.  * DL_XID_REQ, M_PROTO type
  939.  */
  940. typedef struct 
  941. {
  942.     UInt32    dl_primitive;            /* DL_XID_REQ */
  943.     UInt32    dl_flag;                /* poll/final */
  944.     UInt32    dl_dest_addr_length;    /* dlsap length of dest. user */
  945.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  946. } dl_xid_req_t;
  947.  
  948. /*
  949.  * DL_XID_IND, M_PROTO type
  950.  */
  951. typedef struct 
  952. {
  953.     UInt32    dl_primitive;            /* DL_XID_IND */
  954.     UInt32    dl_flag;                /* poll/final */
  955.     UInt32    dl_dest_addr_length;    /* dlsap length of dest. user */
  956.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  957.     UInt32    dl_src_addr_length;     /* dlsap length of source user */
  958.     UInt32    dl_src_addr_offset;     /* offset from beg. of block */
  959. } dl_xid_ind_t;
  960.  
  961. /*
  962.  *    DL_XID_RES, M_PROTO type
  963.  */
  964. typedef struct 
  965. {
  966.     UInt32    dl_primitive;            /* DL_XID_RES */
  967.     UInt32    dl_flag;                /* poll/final */
  968.     UInt32    dl_dest_addr_length;    /* DLSAP length of dest. user */
  969.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  970. } dl_xid_res_t;
  971.  
  972. /*
  973.  *    DL_XID_CON, M_PROTO type
  974.  */
  975. typedef struct 
  976. {
  977.     UInt32    dl_primitive;            /* DL_XID_CON */
  978.     UInt32    dl_flag;                /* poll/final */
  979.     UInt32    dl_dest_addr_length;    /* dlsap length of dest. user */
  980.     UInt32    dl_dest_addr_offset;    /* offset from beg. of block */
  981.     UInt32    dl_src_addr_length;     /* dlsap length of source user */
  982.     UInt32    dl_src_addr_offset;     /* offset from beg. of block */
  983. } dl_xid_con_t;
  984.  
  985. /*
  986.  *    ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES
  987.  */
  988.  
  989. /*
  990.  * DL_DATA_ACK_REQ, M_PROTO type
  991.  */
  992. typedef struct 
  993. {
  994.     UInt32    dl_primitive;            /* DL_DATA_ACK_REQ */
  995.     UInt32    dl_correlation;         /* User's correlation token */
  996.     UInt32    dl_dest_addr_length;    /* length of destination addr */
  997.     UInt32    dl_dest_addr_offset;    /* offset from beginning of block */
  998.     UInt32    dl_src_addr_length;     /* length of source address */
  999.     UInt32    dl_src_addr_offset;     /* offset from beginning of block */
  1000.     UInt32    dl_priority;            /* priority */
  1001.     UInt32    dl_service_class;        /* DL_RQST_RSP or DL_RQST_NORSP */
  1002. } dl_data_ack_req_t;
  1003.  
  1004. /*
  1005.  * DL_DATA_ACK_IND, M_PROTO type
  1006.  */
  1007. typedef struct 
  1008. {
  1009.     UInt32    dl_primitive;            /* DL_DATA_ACK_IND */
  1010.     UInt32    dl_dest_addr_length;    /* length of destination addr */
  1011.     UInt32    dl_dest_addr_offset;    /* offset from beginning of block */
  1012.     UInt32    dl_src_addr_length;     /* length of source address */
  1013.     UInt32    dl_src_addr_offset;     /* offset from beginning of block */
  1014.     UInt32    dl_priority;            /* priority for data unit transm. */
  1015.     UInt32    dl_service_class;        /* DL_RQST_RSP or DL_RQST_NORSP */
  1016. } dl_data_ack_ind_t;
  1017.  
  1018. /*
  1019.  * DL_DATA_ACK_STATUS_IND, M_PROTO type
  1020.  */
  1021. typedef struct 
  1022. {
  1023.     UInt32    dl_primitive;        /* DL_DATA_ACK_STATUS_IND */
  1024.     UInt32    dl_correlation;     /* User's correlation token */
  1025.     UInt32    dl_status;            /* success or failure of previous req*/
  1026. } dl_data_ack_status_ind_t;
  1027.  
  1028. /*
  1029.  * DL_REPLY_REQ, M_PROTO type
  1030.  */
  1031. typedef struct 
  1032. {
  1033.     UInt32    dl_primitive;            /* DL_REPLY_REQ */
  1034.     UInt32    dl_correlation;         /* User's correlation token */
  1035.     UInt32    dl_dest_addr_length;    /* length of destination address */
  1036.     UInt32    dl_dest_addr_offset;    /* offset from beginning of block */
  1037.     UInt32    dl_src_addr_length;     /* source address length */
  1038.     UInt32    dl_src_addr_offset;     /* offset from beginning of block */
  1039.     UInt32    dl_priority;            /* priority for data unit transmission*/
  1040.     UInt32    dl_service_class;
  1041. } dl_reply_req_t;
  1042.  
  1043. /*
  1044.  * DL_REPLY_IND, M_PROTO type
  1045.  */
  1046. typedef struct 
  1047. {
  1048.     UInt32    dl_primitive;            /* DL_REPLY_IND */
  1049.     UInt32    dl_dest_addr_length;    /* length of destination address */
  1050.     UInt32    dl_dest_addr_offset;    /* offset from beginning of block*/
  1051.     UInt32    dl_src_addr_length;     /* length of source address */
  1052.     UInt32    dl_src_addr_offset;     /* offset from beginning of block */
  1053.     UInt32    dl_priority;            /* priority for data unit transmission*/
  1054.     UInt32    dl_service_class;        /* DL_RQST_RSP or DL_RQST_NORSP */
  1055. } dl_reply_ind_t;
  1056.  
  1057. /*
  1058.  * DL_REPLY_STATUS_IND, M_PROTO type
  1059.  */
  1060. typedef struct 
  1061. {
  1062.     UInt32    dl_primitive;        /* DL_REPLY_STATUS_IND */
  1063.     UInt32    dl_correlation;     /* User's correlation token */
  1064.     UInt32    dl_status;            /* success or failure of previous req*/
  1065. } dl_reply_status_ind_t;
  1066.  
  1067. /*
  1068.  * DL_REPLY_UPDATE_REQ, M_PROTO type
  1069.  */
  1070. typedef struct 
  1071. {
  1072.     UInt32    dl_primitive;            /* DL_REPLY_UPDATE_REQ */
  1073.     UInt32    dl_correlation;         /* user's correlation token */
  1074.     UInt32    dl_src_addr_length;     /* length of source address */
  1075.     UInt32    dl_src_addr_offset;     /* offset from beginning of block */
  1076. } dl_reply_update_req_t;
  1077.  
  1078. /*
  1079.  * DL_REPLY_UPDATE_STATUS_IND, M_PROTO type
  1080.  */
  1081. typedef struct 
  1082. {
  1083.     UInt32    dl_primitive;        /* DL_REPLY_UPDATE_STATUS_IND */
  1084.     UInt32    dl_correlation;     /* User's correlation token */
  1085.     UInt32    dl_status;            /* success or failure of previous req*/
  1086. } dl_reply_update_status_ind_t;
  1087.  
  1088. union DL_primitives 
  1089. {
  1090.     UInt32                dl_primitive;
  1091.     dl_info_req_t        info_req;
  1092.     dl_info_ack_t        info_ack;
  1093.     dl_attach_req_t     attach_req;
  1094.     dl_detach_req_t     detach_req;
  1095.     dl_bind_req_t        bind_req;
  1096.     dl_bind_ack_t        bind_ack;
  1097.     dl_unbind_req_t     unbind_req;
  1098.     dl_subs_bind_req_t    subs_bind_req;
  1099.     dl_subs_bind_ack_t    subs_bind_ack;
  1100.     dl_subs_unbind_req_t    subs_unbind_req;
  1101.     dl_ok_ack_t         ok_ack;
  1102.     dl_error_ack_t        error_ack;
  1103.     dl_connect_req_t    connect_req;
  1104.     dl_connect_ind_t    connect_ind;
  1105.     dl_connect_res_t    connect_res;
  1106.     dl_connect_con_t    connect_con;
  1107.     dl_token_req_t        token_req;
  1108.     dl_token_ack_t        token_ack;
  1109.     dl_disconnect_req_t disconnect_req;
  1110.     dl_disconnect_ind_t disconnect_ind;
  1111.     dl_reset_req_t        reset_req;
  1112.     dl_reset_ind_t        reset_ind;
  1113.     dl_reset_res_t        reset_res;
  1114.     dl_reset_con_t        reset_con;
  1115.     dl_unitdata_req_t    unitdata_req;
  1116.     dl_unitdata_ind_t    unitdata_ind;
  1117.     dl_uderror_ind_t    uderror_ind;
  1118.     dl_udqos_req_t        udqos_req;
  1119.     dl_enabmulti_req_t    enabmulti_req;
  1120.     dl_disabmulti_req_t disabmulti_req;
  1121.     dl_promiscon_req_t    promiscon_req;
  1122.     dl_promiscoff_req_t promiscoff_req;
  1123.     dl_phys_addr_req_t    physaddr_req;
  1124.     dl_phys_addr_ack_t    physaddr_ack;
  1125.     dl_set_phys_addr_req_t    set_physaddr_req;
  1126.     dl_get_statistics_req_t get_statistics_req;
  1127.     dl_get_statistics_ack_t get_statistics_ack;
  1128.     dl_test_req_t        test_req;
  1129.     dl_test_ind_t        test_ind;
  1130.     dl_test_res_t        test_res;
  1131.     dl_test_con_t        test_con;
  1132.     dl_xid_req_t        xid_req;
  1133.     dl_xid_ind_t        xid_ind;
  1134.     dl_xid_res_t        xid_res;
  1135.     dl_xid_con_t        xid_con;
  1136.     dl_data_ack_req_t    data_ack_req;
  1137.     dl_data_ack_ind_t    data_ack_ind;
  1138.     dl_data_ack_status_ind_t    data_ack_status_ind;
  1139.     dl_reply_req_t        reply_req;
  1140.     dl_reply_ind_t        reply_ind;
  1141.     dl_reply_status_ind_t    reply_status_ind;
  1142.     dl_reply_update_req_t    reply_update_req;
  1143.     dl_reply_update_status_ind_t    reply_update_status_ind;
  1144. };
  1145.  
  1146. #define DL_INFO_REQ_SIZE    sizeof(dl_info_req_t)
  1147. #define DL_INFO_ACK_SIZE    sizeof(dl_info_ack_t)
  1148. #define DL_ATTACH_REQ_SIZE    sizeof(dl_attach_req_t)
  1149. #define DL_DETACH_REQ_SIZE    sizeof(dl_detach_req_t)
  1150. #define DL_BIND_REQ_SIZE    sizeof(dl_bind_req_t)
  1151. #define DL_BIND_ACK_SIZE    sizeof(dl_bind_ack_t)
  1152. #define DL_UNBIND_REQ_SIZE    sizeof(dl_unbind_req_t)
  1153. #define DL_SUBS_BIND_REQ_SIZE    sizeof(dl_subs_bind_req_t)
  1154. #define DL_SUBS_BIND_ACK_SIZE    sizeof(dl_subs_bind_ack_t)
  1155. #define DL_SUBS_UNBIND_REQ_SIZE sizeof(dl_subs_unbind_req_t)
  1156. #define DL_OK_ACK_SIZE        sizeof(dl_ok_ack_t)
  1157. #define DL_ERROR_ACK_SIZE    sizeof(dl_error_ack_t)
  1158. #define DL_CONNECT_REQ_SIZE     sizeof(dl_connect_req_t)
  1159. #define DL_CONNECT_IND_SIZE     sizeof(dl_connect_ind_t)
  1160. #define DL_CONNECT_RES_SIZE     sizeof(dl_connect_res_t)
  1161. #define DL_CONNECT_CON_SIZE     sizeof(dl_connect_con_t)
  1162. #define DL_TOKEN_REQ_SIZE    sizeof(dl_token_req_t)
  1163. #define DL_TOKEN_ACK_SIZE    sizeof(dl_token_ack_t)
  1164. #define DL_DISCONNECT_REQ_SIZE    sizeof(dl_disconnect_req_t)
  1165. #define DL_DISCONNECT_IND_SIZE    sizeof(dl_disconnect_ind_t)
  1166. #define DL_RESET_REQ_SIZE    sizeof(dl_reset_req_t)
  1167. #define DL_RESET_IND_SIZE    sizeof(dl_reset_ind_t)
  1168. #define DL_RESET_RES_SIZE    sizeof(dl_reset_res_t)
  1169. #define DL_RESET_CON_SIZE    sizeof(dl_reset_con_t)
  1170. #define DL_UNITDATA_REQ_SIZE    sizeof(dl_unitdata_req_t)
  1171. #define DL_UNITDATA_IND_SIZE    sizeof(dl_unitdata_ind_t)
  1172. #define DL_UDERROR_IND_SIZE     sizeof(dl_uderror_ind_t)
  1173. #define DL_UDQOS_REQ_SIZE    sizeof(dl_udqos_req_t)
  1174. #define DL_ENABMULTI_REQ_SIZE    sizeof(dl_enabmulti_req_t)
  1175. #define DL_DISABMULTI_REQ_SIZE    sizeof(dl_disabmulti_req_t)
  1176. #define DL_PROMISCON_REQ_SIZE    sizeof(dl_promiscon_req_t)
  1177. #define DL_PROMISCOFF_REQ_SIZE    sizeof(dl_promiscoff_req_t)
  1178. #define DL_PHYS_ADDR_REQ_SIZE    sizeof(dl_phys_addr_req_t)
  1179. #define DL_PHYS_ADDR_ACK_SIZE    sizeof(dl_phys_addr_ack_t)
  1180. #define DL_SET_PHYS_ADDR_REQ_SIZE    sizeof(dl_set_phys_addr_req_t)
  1181. #define DL_GET_STATISTICS_REQ_SIZE    sizeof(dl_get_statistics_req_t)
  1182. #define DL_GET_STATISTICS_ACK_SIZE    sizeof(dl_get_statistics_ack_t)
  1183. #define DL_XID_REQ_SIZE     sizeof(dl_xid_req_t)
  1184. #define DL_XID_IND_SIZE     sizeof(dl_xid_ind_t)
  1185. #define DL_XID_RES_SIZE     sizeof(dl_xid_res_t)
  1186. #define DL_XID_CON_SIZE     sizeof(dl_xid_con_t)
  1187. #define DL_TEST_REQ_SIZE    sizeof(dl_test_req_t)
  1188. #define DL_TEST_IND_SIZE    sizeof(dl_test_ind_t)
  1189. #define DL_TEST_RES_SIZE    sizeof(dl_test_res_t)
  1190. #define DL_TEST_CON_SIZE    sizeof(dl_test_con_t)
  1191. #define DL_DATA_ACK_REQ_SIZE    sizeof(dl_data_ack_req_t)
  1192. #define DL_DATA_ACK_IND_SIZE    sizeof(dl_data_ack_ind_t)
  1193. #define DL_DATA_ACK_STATUS_IND_SIZE     sizeof(dl_data_ack_status_ind_t)
  1194. #define DL_REPLY_REQ_SIZE    sizeof(dl_reply_req_t)
  1195. #define DL_REPLY_IND_SIZE    sizeof(dl_reply_ind_t)
  1196. #define DL_REPLY_STATUS_IND_SIZE    sizeof(dl_reply_status_ind_t)
  1197. #define DL_REPLY_UPDATE_REQ_SIZE    sizeof(dl_reply_update_req_t)
  1198. #define DL_REPLY_UPDATE_STATUS_IND_SIZE sizeof(dl_reply_update_status_ind_t)
  1199.  
  1200. #ifndef MIOC_CMD
  1201. #include <miioccom.h>
  1202. #endif
  1203.  
  1204. #define DLIOCRAW    MIOC_CMD(MIOC_DLPI,1)        /* M_DATA "raw" mode */
  1205. #define DL_IOC_HDR_INFO MIOC_CMD(MIOC_DLPI,10)        /* ??? */
  1206.  
  1207. #endif /* _SYS_DLPI_H */
  1208.